package com.atguigu.userprofile.dao;

import com.atguigu.userprofile.bean.TaskTagRule;
import com.atguigu.userprofile.utils.MySQLUtil;

import java.util.List;

public class TaskTagRuleDAO {
    public static List<TaskTagRule> getTaskTagRule(String taskId){
        String querySql = "SELECT \n" +
                "\tttr.id,\n" +
                "\tttr.tag_id,\n" +
                "\tttr.task_id,\n" +
                "\tttr.query_value,\n" +
                "\tttr.sub_tag_id,\n" +
                "\tti.tag_name as sub_tag_value \n" +
                "FROM task_tag_rule ttr \n" +
                "JOIN tag_info ti \n" +
                "ON ttr.sub_tag_id=ti.id\n" +
                "WHERE task_id = "+taskId+"";

        List<TaskTagRule> taskTagRules = MySQLUtil.queryList(querySql, TaskTagRule.class, true);
        return taskTagRules;
    }
}
